package com.bj58.groupbuy.action.service;

import java.util.HashMap;
import java.util.List;

import com.bj58.groupbuy.action.model.IRColumns;
import com.bj58.groupbuy.action.model.IRDrillConfig;
import com.bj58.groupbuy.action.model.IRReport;
import com.bj58.groupbuy.action.model.IRSearchConfig;
import com.bj58.groupbuy.action.model.Menu;
import com.bj58.groupbuy.action.model.User;
import com.bj58.groupbuy.wf.page.Paginate;

public interface IntReportMainService {
	
	
	/**保存新的报表配置  
	 * @param vo        报表基本数据
	 * @param ircList   查询条件
	 * @param colList  查询字段
	 * @return
	 * @throws Exception
	 */
	public boolean saveNewReport(IRReport irReport ,Menu  menu ,List<IRSearchConfig> ircList,List<IRColumns> colList,List<IRDrillConfig> irdList)throws Exception;
	
	
	
	/**通用查询接口
	 * @param irReport   报表主体信息
	 * @param condition   查询WHERE
	 * @param cols    查询字段
	 * @param orderby  排序
	 * @param groupby 分组
	 * @param pageNum  分页 - 每页数
	 * @param pageIndex 分页 - 页码
	 * @return
	 */
	public Paginate<String>  IRsearchValues(IRReport  irReport,String condition,List<String> cols,List<String> drills,String orderBy,String groupBy,int pageNum,int pageIndex,String specialValues,int dailysum)throws Exception;
	
	/**不分页通用查询接口
	 * @param irReport   报表主体信息
	 * @param condition   查询WHERE
	 * @param cols    查询字段
	 * @param groupby 分组
	 * @return Map<维度组合,记录>
	 */
	public  HashMap<String,String>  IRsearchValuesNonPage(IRReport  irReport,String condition, List<String> cols,List<String> drills, String groupby,String specialValues)throws Exception;
	
	
	/**修改报表状态
	 * @param reportId   
	 * @param state
	 * @return
	 * @throws Exception
	 */
	public boolean updateReportState(int reportId,int state)throws Exception;
	
	
	/**更新编辑过的报表配置  
	 * @param vo        报表基本数据
	 * @param ircList   查询条件
	 * @param colList  查询字段
	 * @return
	 * @throws Exception
	 */
	public boolean updateEditedReport(IRReport irReport ,Menu  menu ,List<IRSearchConfig> ircList,List<IRColumns> colList,List<IRDrillConfig> irdList)throws Exception;


	/**存入访问记录
	 * @param userName  用户名
	 * @param url	 			报表URL
	 * @throws Exception
	 */
	public void inserVisitRecord(String userName,String url)throws Exception;
	
	
	/**业务线细粒度权限检查
	 */
	public String businessOperCheck(User user,String showBusi)throws Exception;
	
	
	/**流量来源钟中英文翻译转换
	 * @param irReport
	 * @param result
	 * @param groupby
	 * @return
	 * @throws Exception
	 */
	public Paginate<String> flowSourceNameTran(Paginate<String>  result)throws Exception;
	
	
	/**存入查询记录
	 * @throws Exception
	 */
	/**
	 * @param menuId  自定义报表菜单ID
	 * @param groupBy  查询维度
	 * @throws Exception
	 */
	public void inserSearchRecord(String menuId , String groupBy ,String userName,String searchCols)throws Exception;

	
	/**城市权限检查
	 */
	public String cityOperCheck(User user)throws Exception;
}
